
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

using TwitterClient;

namespace SigTweet
{
	public partial class TwitterTableCellController : UIViewController
	{
		#region Constructors

		// The IntPtr and NSCoder constructors are required for controllers that need 
		// to be able to be created from a xib rather than from managed code

		public TwitterTableCellController (IntPtr handle) : base(handle)
		{
			Initialize ();
		}

		[Export("initWithCoder:")]
		public TwitterTableCellController (NSCoder coder) : base(coder)
		{
			Initialize ();
		}

		public TwitterTableCellController () : base("TwitterTableCellController", null)
		{
			Initialize ();
		}

		void Initialize ()
		{
		}

		#endregion

		public Tweet CurrentTweet {
			get { return _currentTweet; }
			set {
				
				_currentTweet = value;
				
				if (_currentTweet != null) {
					senderLabel.Text = String.Format ("{0} says...", _currentTweet.PostedBy);
					updateLabel.Text = _currentTweet.UpdateText;
					sentAtLabel.Text = _currentTweet.PostedAt.ToString ("ddd h:mm tt");
				}
			}
		}

		public UITableViewCell Cell {
			get { return cell; }
		}

		private Tweet _currentTweet;
	}
}
